﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SLP
{
    /// <summary>
    /// User for all heiarchical data storage (Files, Registry Entries)
    /// </summary>
    public class FolderItem : Item
    {
        ObservableCollection<Item> _Items;
        public ObservableCollection<Item> Items
        {
            get { return _Items; }
            set
            {
                if (value != _Items)
                {
                    _Items = value;
                    OnChanged("Items");
                }
            }
        }
        
        public bool HasChildren
        {
            get
            {
                if (_Items!=null)
                {
                    return _Items.Count > 0;
                }
                return false;
            }
        }

        public FolderItem()
        {
            _Items = new ObservableCollection<Item>();
        }
    }
}

